<?php

namespace app\common\model\dealer;

use app\common\model\BaseModel;
use app\common\enum\user\dealerlog\Scene as SceneEnum;
/**
 * 分销商资金明细模型
 * Class Apply
 * @package app\common\model\dealer
 */
class Capital extends BaseModel
{
    protected $name = 'dealer_capital';

    /**
     * 余额变动场景
     * @param $value
     * @return array
     */
    public function getFlowTypeAttr($value)
    {
        return ['text' => SceneEnum::data()[$value]['name'], 'value' => $value];
    }

    /**
     * 分销商资金明细
     * @param $data
     */
    public static function add($data)
    {
        $model = new static;
        $model->save(array_merge([
            'wxapp_id' => $model::$wxapp_id
        ], $data));
    }


}